package com.etc.Day4;

/**
 * @Author kalista
 * @Description 动物
 * @Date 2020/10/26  10:23
 **/
public class Animal {


    // 继承中的变量的访问的特点
    String name;
    int id;

    public Animal(String name, int id) {
        this.name = name;
        this.id = id;
    }


    protected   void eat() {
        System.out.println(this.name + "正在吃");
    }

    public void sleep() {
        System.out.println(this.name + "睡觉奥");
    }

    public void introduction() {
        System.out.println("大家好我是" + this.id + "号" + "我的名字是" + this.name);
    }

}
